#ifndef WINMACROLIB_H
#define WINMACROLIB_H

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the WINMACROLIB_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// WINMACROLIB_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef WINMACROLIB_EXPORTS
#define WINMACROLIB_API __declspec(dllexport)
#else
#define WINMACROLIB_API __declspec(dllimport)
#endif

const char signature[] = "SADHU";
const DWORD signature_length = sizeof(signature)/sizeof(char);

typedef struct
{
	bool normal_speed;
	bool add_to_recorded_time;
	unsigned long user_defined_time_interval;
	DWORD repeat_count;
} PLAYBACKOPTIONS;

typedef struct
{
	bool ignore_mouse_actions;
} RECORDINGOPTIONS;

typedef struct
{
	int current_iteration_number;
	int total_number_of_iterations;
	int current_message_number;
	int total_number_of_messages;
} PLAYBACKPROGRESSINFO;

typedef void (CALLBACK* RECORDINGSTOPPEDPROC)();
typedef void (CALLBACK* PLAYBACKSTOPPEDPROC)();
typedef void (CALLBACK* PLAYBACKPROGRESSPROC)(PLAYBACKPROGRESSINFO progress_info);


extern "C" WINMACROLIB_API DWORD ReadMacroFile(LPCTSTR fileName, EVENTMSG **messages, DWORD *message_count);
extern "C" WINMACROLIB_API DWORD WriteMacroFile(LPCTSTR fileName, EVENTMSG* messages, DWORD message_count);
extern "C" WINMACROLIB_API DWORD PlaybackFrom(LPCTSTR fileName, PLAYBACKOPTIONS options, PLAYBACKSTOPPEDPROC proc, PLAYBACKPROGRESSPROC playback_progress_proc);
extern "C" WINMACROLIB_API  DWORD RecordTo(LPCTSTR fileName, RECORDINGOPTIONS options, RECORDINGSTOPPEDPROC proc);

void uninstall_playback_hook();
BOOL IsMouseMessage(UINT msg);

#endif